<div class="x_panel">
    <div class="x_title">
        <h2>人员
            <small>修改</small>
        </h2>
        <div class="clearfix"></div>
    </div>
    <div class="x_content">
        <br/>
        <form id="defaultForm" th:object="${emp}" data-parsley-validate=""
              class="form-horizontal form-label-left" novalidate="" method="post">
            <div class="form-group">
                <label class="control-label col-md-3 col-sm-3 col-xs-12">人员编码
                </label>
                <div class="col-md-6 col-sm-6 col-xs-12">
                    <input type="text" name="empCode" style="background: none" id="empCode" readonly="readonly" required="required" class="form-control col-md-7 col-xs-12"
                           th:value="*{empCode}"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-md-3 col-sm-3 col-xs-12">人员姓名
                </label>
                <div class="col-md-6 col-sm-6 col-xs-12">
                    <input type="text" name="empName" style="background: none" id="empName" readonly="readonly" required="required" class="form-control col-md-7 col-xs-12"
                           th:value="*{empName}"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-md-3 col-sm-3 col-xs-12">登录账号
                </label>
                <div class="col-md-6 col-sm-6 col-xs-12">
                    <input type="text" name="empLogin" style="background: none" id="empLogin" readonly="readonly" required="required" class="form-control col-md-7 col-xs-12"
                           th:value="*{loginName}"/>
                </div>
            </div>
                    <input type="hidden" style="background: none" readonly="readonly" name="empPwd" required="required" class="form-control col-md-7 col-xs-12"
                           th:value="*{loginPwd}"/>


            <div class="form-group">
                <label class="control-label col-md-3 col-sm-3 col-xs-12">性别</label>
                <div class="col-md-6 col-sm-6 col-xs-12">
                    <input type="text" name="empSex" style="background: none" id="empSex" readonly="readonly" required="required" class="form-control col-md-7 col-xs-12"
                           th:value="*{gender}=='男'?'男':'女'"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-md-3 col-sm-3 col-xs-12">使用状态</label>
                <div class="col-md-6 col-sm-6 col-xs-12" style="margin-top: 8px">
                    <input type="text" name="sts" style="background: none" readonly="readonly" required="required" class="form-control col-md-7 col-xs-12"
                           th:value="*{sts}=='1'?'使用':'未使用'"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-md-3 col-sm-3 col-xs-12">联系方式</label>
                <div class="col-md-6 col-sm-6 col-xs-12">
                    <input type="text" name="empTel" style="background: none" required="required" readonly="readonly" class="form-control col-md-7 col-xs-12"
                           th:value="*{contactNumber}"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-md-3 col-sm-3 col-xs-12">电子邮件</label>
                <div class="col-md-6 col-sm-6 col-xs-12">
                    <input type="text" name="email" style="background: none" readonly="readonly" required="required" class="form-control col-md-7 col-xs-12"
                           th:value="*{email}"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-md-3 col-sm-3 col-xs-12">用工形式
                </label>
                <div class="col-md-6 col-sm-6 col-xs-12">
                    <input type="text"  name="empMode" required="required" readonly="readonly" th:value="*{empMode}=='14'?'正式':'临时'"
                           oninvalid="setCustomValidity('请输入用工形式');" class="form-control col-md-7 col-xs-12" />
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-md-3 col-sm-3 col-xs-12">所属部门</label>
                <div class="col-md-6 col-sm-6 col-xs-12">
                    <div class="input-group col-md-12">
                        <input type="text" name="orgName" style="background: none" readonly="readonly" required="required" class="form-control col-md-7 col-xs-12"
                               th:value="${orgNames}"/>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-md-3 col-sm-3 col-xs-12">角色名称</label>
                <div class="col-md-6">
                    <input type="text" name="empRole" style="background: none" readonly="readonly" required="required" class="form-control col-md-7 col-xs-12"
                           th:value="${roleNames}"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                    <button class="btn btn-primary" th:id="*{empId}" name="update" type="button" onclick="updateEmp(this)">修改</button>
                    <button type="button" onclick="find()" th:id="*{empId}" class="btn btn-success">返回</button>
                </div>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript" th:inline="javascript">
    var flag=[[${flags}]];
    if(flag==0){
        $("button[name=update]").hide();
    }else if(flag==1) {
        $("button[name=update]").show();
    }
</script>
